package com.whiteape.book.ui.activity;

import android.view.KeyEvent;

import androidx.fragment.app.Fragment;

import com.whiteape.book.R;
import com.whiteape.book.ui.base.BaseActivity;
import com.whiteape.book.ui.base.BaseFragment;
import com.whiteape.book.ui.fragment.SiteSourceFragment;

import java.util.List;

public class SiteSourceManageActivity extends BaseActivity {
    @Override
    protected int getContentId() {
        return R.layout.activity_site_source_manage;
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        List<Fragment> fragmentList = getSupportFragmentManager().getFragments();
        if (fragmentList.size() > 0) {
            Fragment child = fragmentList.get(0);
            if (child instanceof SiteSourceFragment) {
                if (((BaseFragment) child).onKeyDown(keyCode, event)) {
                    return true;
                }
            }

        }
        return super.onKeyDown(keyCode, event);
    }
}
